package com.weido.Filter;

import com.weido.nettyServer.core.Filter;
import com.weido.nettyServer.core.FilterChain;
import com.weido.nettyServer.core.HttpRequest;
import com.weido.nettyServer.core.HttpResponse;
import org.springframework.stereotype.Component;

@Component
public class MyFilter implements Filter {
    @Override
    public void doFilter(HttpRequest request, HttpResponse response, FilterChain chain) {
        String url = request.getUrl();
        if("/".equals(request.getUrl())){
            request.setUrl("/first/welcome");
        }
        chain.doFilter(request,response,chain);
    }
}
